#!/usr/bin/perl -w

sub by_name {
"\L$b" cmp "\L$a" 
or
"\L$name{$b}" cmp "\L$name{$a}";
}

my %name = qw / fred flinstone Wilma Flinstone Barney Rubble betty rubble
 Bamm-Bamm Rubble PEBBLES FLINSTONE /;

@array = sort by_name keys %name;
foreach ( @array ) {
print "$name{$_}, $_  \n";
}
